<?php

namespace Home\Controller;

use Think\Controller;
/**
 * Description of AdvertisementController.class控制器实例
 *
 * @author zhangzhen 
 * @date 2017-3-29 
 */
class AdvertisementController extends Controller {

    protected function _initialize() {
    }

    /**
     * @description 获取广告
     * @modify zhangzhen 2017-03-29
     */
    public function hotelrest() {
        $redisUtil = new \Redis();
        $redisUtil->connect(C('REDIS_SERVERIP'), C('REDIS_SERVERPORT'));
        $redisUtil->auth(C('REDIS_AUTH_PASSWORD'));
        $rest = $redisUtil->get('hotelrest');
        if (empty($rest)) {
            returnJson(200, 200, 0);
        } else {
            returnJson(200, 200, $rest);
        }
    }
}
